<?php

namespace App\Helpers;
use Illuminate\Database\Eloquent\Model;
class SearchService
{
    public static function searchInNameAndContent(Model $model, $name)
    {
        return $model::where('name', 'like', '%'.$name.'%')
            ->orWhere('content', 'like', '%'.$name.'%')
            ->get();
    }
}
